.class public Lcom/teewoo/app/bus/util/geocoding/XMLParse;
.super Ljava/lang/Object;
.source "XMLParse.java"


# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 17
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static getAddress(Ljava/io/InputStream;)Lcom/teewoo/app/bus/model/geocoding/CityAddress;
    .locals 5
    .parameter "inputStream"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    .prologue
    .line 25
    const/4 v0, 0x0

    .line 26
    .local v0, address:Lcom/teewoo/app/bus/model/geocoding/CityAddress;
    invoke-static {}, Landroid/util/Xml;->newPullParser()Lorg/xmlpull/v1/XmlPullParser;

    move-result-object v2

    .line 27
    .local v2, parser:Lorg/xmlpull/v1/XmlPullParser;
    const-string v3, "UTF-8"

    invoke-interface {v2, p0, v3}, Lorg/xmlpull/v1/XmlPullParser;->setInput(Ljava/io/InputStream;Ljava/lang/String;)V

    .line 28
    invoke-interface {v2}, Lorg/xmlpull/v1/XmlPullParser;->getEventType()I

    move-result v1

    .line 30
    .local v1, event:I
    :goto_0
    const/4 v3, 0x1

    if-ne v1, v3, :cond_0

    .line 58
    return-object v0

    .line 31
    :cond_0
    packed-switch v1, :pswitch_data_0

    .line 56
    :cond_1
    :goto_1
    :pswitch_0
    invoke-interface {v2}, Lorg/xmlpull/v1/XmlPullParser;->next()I

    move-result v1

    goto :goto_0

    .line 33
    :pswitch_1
    new-instance v0, Lcom/teewoo/app/bus/model/geocoding/CityAddress;

    .end local v0           #address:Lcom/teewoo/app/bus/model/geocoding/CityAddress;
    invoke-direct {v0}, Lcom/teewoo/app/bus/model/geocoding/CityAddress;-><init>()V

    .line 34
    .restart local v0       #address:Lcom/teewoo/app/bus/model/geocoding/CityAddress;
    goto :goto_1

    .line 36
    :pswitch_2
    if-eqz v0, :cond_1

    .line 37
    const-string v3, "code"

    invoke-interface {v2}, Lorg/xmlpull/v1/XmlPullParser;->getName()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_2

    .line 38
    invoke-interface {v2}, Lorg/xmlpull/v1/XmlPullParser;->nextText()Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I

    move-result v3

    invoke-virtual {v0, v3}, Lcom/teewoo/app/bus/model/geocoding/CityAddress;->setCode(I)V

    goto :goto_1

    .line 39
    :cond_2
    const-string v3, "address"

    invoke-interface {v2}, Lorg/xmlpull/v1/XmlPullParser;->getName()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_3

    .line 40
    invoke-interface {v2}, Lorg/xmlpull/v1/XmlPullParser;->nextText()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Lcom/teewoo/app/bus/model/geocoding/CityAddress;->setAddress(Ljava/lang/String;)V

    goto :goto_1

    .line 41
    :cond_3
    const-string v3, "CountryName"

    invoke-interface {v2}, Lorg/xmlpull/v1/XmlPullParser;->getName()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_4

    .line 42
    invoke-interface {v2}, Lorg/xmlpull/v1/XmlPullParser;->nextText()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Lcom/teewoo/app/bus/model/geocoding/CityAddress;->setCountryName(Ljava/lang/String;)V

    goto :goto_1

    .line 43
    :cond_4
    const-string v3, "AdministrativeAreaName"

    invoke-interface {v2}, Lorg/xmlpull/v1/XmlPullParser;->getName()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_5

    .line 44
    invoke-interface {v2}, Lorg/xmlpull/v1/XmlPullParser;->nextText()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Lcom/teewoo/app/bus/model/geocoding/CityAddress;->setAdministrativeAreaName(Ljava/lang/String;)V

    goto :goto_1

    .line 45
    :cond_5
    const-string v3, "LocalityName"

    invoke-interface {v2}, Lorg/xmlpull/v1/XmlPullParser;->getName()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_6

    .line 46
    invoke-interface {v2}, Lorg/xmlpull/v1/XmlPullParser;->nextText()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Lcom/teewoo/app/bus/model/geocoding/CityAddress;->setLocalityName(Ljava/lang/String;)V

    goto :goto_1

    .line 47
    :cond_6
    const-string v3, "DependentLocalityName"

    invoke-interface {v2}, Lorg/xmlpull/v1/XmlPullParser;->getName()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_7

    .line 48
    invoke-interface {v2}, Lorg/xmlpull/v1/XmlPullParser;->nextText()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Lcom/teewoo/app/bus/model/geocoding/CityAddress;->setDependentLocalityName(Ljava/lang/String;)V

    goto/16 :goto_1

    .line 49
    :cond_7
    const-string v3, "ThoroughfareName"

    invoke-interface {v2}, Lorg/xmlpull/v1/XmlPullParser;->getName()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_1

    .line 50
    invoke-interface {v2}, Lorg/xmlpull/v1/XmlPullParser;->nextText()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Lcom/teewoo/app/bus/model/geocoding/CityAddress;->setThoroughfareName(Ljava/lang/String;)V

    goto/16 :goto_1

    .line 31
    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_1
        :pswitch_0
        :pswitch_2
    .end packed-switch
.end method
